package com.project.service.imp;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.DetailBean;
import com.project.bean.OrderBean;
import com.project.mapper.IOrderMapper;
import com.project.service.IOrderService;
import org.apache.ibatis.session.SqlSession;

public class OrderServiceImp extends BaseService implements IOrderService {
    private IOrderMapper mapper;
    @Override
    public PageInfo<OrderBean> cutPageByCondition(Integer pageNum, String people) {
        PageHelper.startPage(pageNum,1);
        PageInfo<OrderBean> pageInfo =PageInfo.of(mapper.cutPageByCondition(people));
        return pageInfo;
    }

    @Override
    public void add(OrderBean orderBean) {
        mapper.addOrd(orderBean);
        mapper.addDet(orderBean);
    }

    @Override
    public OrderBean orderById(Integer id) {
        OrderBean orderBean= mapper.orderById(id);
        return orderBean;
    }
}
